package org.com.system.email;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.com.system.user.pojo.User;
import org.hibernate.annotations.GenericGenerator;

@Entity
@Table(name="sys_email_info")
public class Email {

	private String id;
    private String emailType;//邮箱类型
	private String emailUser;//邮箱账户名
	private String emailPass;//邮箱密码
	private List<SendMail> sendMails=null;
	private List<InceptMail> inceptMail=null;
    private User user;
	
	@Id
	@GeneratedValue(generator="uuidGenerator")      
	@GenericGenerator(name="uuidGenerator",strategy="uuid")
	@Column(name="id", unique=true, nullable=false)
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	
	public String getEmailType() {
		return emailType;
	}
	public void setEmailType(String emailType) {
		this.emailType = emailType;
	}
	public String getEmailUser() {
		return emailUser;
	}
	public void setEmailUser(String emailUser) {
		this.emailUser = emailUser;
	}
	public String getEmailPass() {
		return emailPass;
	}
	public void setEmailPass(String emailPass) {
		this.emailPass = emailPass;
	}
	@OneToMany(cascade=CascadeType.ALL,fetch=FetchType.LAZY,mappedBy="id",targetEntity=SendMail.class)
	public List<SendMail> getSendMails() {
		return sendMails;
	}
	public void setSendMails(List<SendMail> sendMails) {
		this.sendMails = sendMails;
	}
	@OneToMany(cascade=CascadeType.ALL,fetch=FetchType.LAZY,mappedBy="id",targetEntity=InceptMail.class)
	public List<InceptMail> getInceptMail() {
		return inceptMail;
	}
	public void setInceptMail(List<InceptMail> inceptMail) {
		this.inceptMail = inceptMail;
	}
	@OneToOne(cascade=CascadeType.ALL,fetch=FetchType.LAZY,mappedBy="id",targetEntity=User.class)
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	
}
